home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-1.iso / Files / Educ / Calc / CalcWorks 1.42.sit / CalcWorks.rsrc / TEXT_212_Help - Binary Functions.txt < prev    next >
Encoding:
Text File  |  1995-04-17  |  2.8 KB  |  39 lines

  1. Binary Functions
  2.  
  3. In any of the binary math modes, the number type (signed or unsigned) can be changed using the [SIGN] button, and the word size (byte - 8 bits, word - 16 bits, or long - 32 bits) can be changed using the [SIZE] button. The size changes from B->W->L as you press the [SIZE] button, or from L->W->B if you press the [SIZE] button while the [2nd] button is depressed. The current sign and word size is shown in the display as ‚ÄòSBYTE‚Äô, ‚ÄòUBYTE‚Äô, ‚ÄòSWORD‚Äô, ‚ÄòUWORD‚Äô, ‚ÄòSLONG‚Äô, or ‚ÄòULONG‚Äô. You can also select the size and sign by using the popup menus that appear if you hold the button down until the menu appears. If the Pad binary numbers option is selected in the Number Format dialog, all numbers displayed in these modes will be padded with leading zeros to the currently selected word size.
  4.  
  5. A displayed number may be truncated or sign-extended when switching word sign or size, depending on the size of the number. If it is truncated, an error message will appear in the display, but you can still continue with the calculation if you wish.
  6.  
  7. Binary math functions are available in [Bin], [Oct], [Dec], and [Hex] modes only and are as follows...
  8.  
  9.   [AND]  Bit wise AND
  10.   [OR ]  Bit wise OR
  11.   [XOR]  Bit wise exclusive OR
  12.   [MOD]  Modulus (division remainder)
  13.   [NOT]  One's complement
  14.   [NEG]  Negate (two's complement)
  15.   [ASL]  Arithmetic shift left
  16.   [ASR]  Arithmetic shift right
  17.   [LSL]  Logical shift left
  18.   [LSR]  Logical shift right
  19.   [ROL]  Rotate left
  20.   [ROR]  Rotate right
  21.   [ASLx] Arithmetic shift left ‚Äòx‚Äô bits
  22.   [ASRx] Arithmetic shift right ‚Äòx‚Äô bits
  23.   [LSLx] Logical shift left ‚Äòx‚Äô bits
  24.   [LSRx] Logical shift right ‚Äòx‚Äô bits
  25.   [ROLx] Rotate left ‚Äòx‚Äô bits
  26.   [RORx] Rotate right ‚Äòx‚Äô bits
  27.  
  28. The last six operations (shift and rotate ‚Äòx‚Äô operations) use locking buttons, similar to the extended memory functions. Press the button and the button locks, then press a number button 0-9 or A-F, and the operation is completed. Shifts or rotates of 1 to 16 bits are possible with these operations (pressing the 0 button shifts 16 bits). The number of bit positions is also selectable from the popup menu for each button.
  29.  
  30. All operations in this mode (except as noted) execute the corresponding 680x0 instruction directly and then check the CPU condition codes and display the codes in the display. For multiplication, division, and modulus operations, the operation is carried out using floating point arithmetic, then the result is moved into a data register, and the condition codes are checked and displayed. The condition codes displayed are...
  31.  
  32.     C    Carry
  33.     V    oVerflow (result overflow)
  34.     Z    Zero (result is zero)
  35.     N    Negative (high-order bit is set)
  36.  
  37. An upper case character indicates the condition is true (bit set), while lower case indicates false (bit cleared). 
  38.  
  39.